package com.nuoniu.sibanyun.mapper.crm.call;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nuoniu.sibanyun.entity.crm.call.CrmCallMinutes;
import com.nuoniu.sibanyun.entity.crm.call.vo.CrmCallMinutesSimpleVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 客户管理-呼叫分钟数 Mapper 接口
 * </p>
 *
 * @author 白强
 * @since 2022-05-25
 */
public interface CrmCallMinutesMapper extends BaseMapper<CrmCallMinutes> {

    @Select("SELECT * FROM crm_call_minutes WHERE `year` = #{year} AND `month` = #{month} ")
    List<CrmCallMinutes> listLastMonth(Integer year, Integer month);

    /**
     * 查询 需要 自动续费的租户
     * @param page
     * @return
     */

    Page<CrmCallMinutesSimpleVo> pageAutoRenewalData(Page page,Integer year,Integer month);


}
